Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use builtin.Empty instead of Unit typealias in Kotlin #904

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

worstell
Copy link
Contributor

@worstell worstell commented Feb 8, 2024

fixes #878

Copy link

codesandbox bot commented Feb 8, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Comment on lines +99 to 105
assert.Equal(t, map[string]any{}, resp.body)
}),
httpCall(rd, http.MethodDelete, "/users/123", jsonData(t, obj{}), func(t testing.TB, resp *httpResponse) {
assert.Equal(t, 200, resp.status)
assert.Equal(t, []string{"Header from FTL"}, resp.headers["Delete"])
assert.Equal(t, nil, resp.body)
assert.Equal(t, map[string]any{}, resp.body)
}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should leave one of these Unit so we can ensure that nil works as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the /empty path still tests Unit!

httpCall(rd, http.MethodGet, "/empty", nil, func(t testing.TB, resp *httpResponse) {
	assert.Equal(t, 200, resp.status)
	assert.Equal(t, nil, resp.headers["Content-Type"])
	assert.Equal(t, nil, resp.bodyBytes)
}),

@worstell worstell merged commit 9788c7d into main Feb 8, 2024
11 checks passed
@worstell worstell deleted the worstell/20240208-empty-response-kotlin branch February 8, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure out how to create an empty response in Kotlin
2 participants